from IP_Spider import daily_check
from impoter_bag import *
from my_api import *

con = rq.get(TEXT_URL, headers=get_ua(), proxies=get_ip(), timeout=10)
daily_check()

if __name__ == '__main__':
    print('IP: ', get_ip())
    os.system('pause')
    if len(sys.argv) >= 2:
        if 'shell' in sys.argv:
            while True:
                try:
                    hold = 0
                    order = ''
                    temp = input('>>> ')
                    if temp.rstrip() and temp.rstrip()[-1] == ':':
                        hold = 1
                        order += temp.rstrip() + '\n'
                    else:
                        hold = 0
                    while hold:
                        temp = input('... ')
                        if temp.rstrip() and temp.rstrip()[-1] == ':':
                            hold = 1
                            order += temp.rstrip() + '\n'
                        else:
                            hold = 0
                    order = order.replace('\t','    ')
                    exec(order)
                    order = ''
                except Exception as error:
                    print(order)
                    print(error)
                    hold = 0
                    order = ''
